Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Extend REPL to support external metadata storage and data storage #381

Merged
merged 7 commits into from
Aug 28, 2024

Conversation

noCharger
Copy link
Collaborator

@noCharger noCharger commented Jun 12, 2024

Description

This is the last PR of [RFC] Flint main class refactor

  1. Introduce new spark conf for REPL to support external metadata storage and data storage access
spark.flint.job.customSessionManager
spark.flint.job.customStatementManager
spark.flint.job.customQueryResultWriter
  1. Add new interfaces with default implementation which uses original opensearch reader and writer
flint-commons/src/main/scala/org/apache/spark/sql/SessionManager.scala
flint-commons/src/main/scala/org/apache/spark/sql/StatementsExecutionManager.scala
flint-commons/src/main/scala/org/apache/spark/sql/QueryResultWriter.scala

spark-sql-application/src/main/scala/org/apache/spark/sql/SessionManagerImpl.scala
spark-sql-application/src/main/scala/org/apache/spark/sql/StatementsExecutionManagerImpl.scala
spark-sql-application/src/main/scala/org/apache/spark/sql/QueryResultWriterImpl.scala
  1. Decouple OpenSearch specific logics from FlintREPL
  • FlintReader for reading request metadata (statement doc), now is moved to StatementsExecutionManagerImpl
  • osClient for reading request metadata (session doc), now is moved to SessionManagerImpl
  • osClient for writing result data, now is moved to QueryResultWriterImpl
  • OpenSearchUpdater for write request metadata (session doc and statement doc), now is moved to SessionManagerImpl and StatementsExecutionManagerImpl
  1. Make resultIndex as optional for FlintREPL, to support external data storage

Issues Resolved

#376

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@noCharger noCharger force-pushed the repl-refactor branch 12 times, most recently from 3cc87db to 22965c0 Compare June 20, 2024 07:01
@noCharger noCharger force-pushed the repl-refactor branch 5 times, most recently from 84312d5 to 35ed065 Compare June 21, 2024 23:45
Copy link
Collaborator

@kaituo kaituo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides CI, what manual tests have you done? Have you done the following two:
First, can we stop a job when another job exclude it using exclude id?
Second, if a query takes too long, will we can cancel the query?

@noCharger noCharger force-pushed the repl-refactor branch 3 times, most recently from ff41d16 to 1b277ad Compare August 15, 2024 15:43
@noCharger noCharger self-assigned this Aug 15, 2024
@noCharger noCharger added 0.5.1 enhancement New feature or request labels Aug 15, 2024
@noCharger noCharger changed the title REPL refactor [Refactor] Extend REPL to support external metadata storage and data storage Aug 16, 2024
@noCharger noCharger marked this pull request as ready for review August 16, 2024 03:33
Signed-off-by: Louis Chu <[email protected]>
Signed-off-by: Louis Chu <[email protected]>
@noCharger noCharger merged commit aa509ac into opensearch-project:main Aug 28, 2024
5 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 28, 2024
…storage (#381)

* REPL refactor

Signed-off-by: Louis Chu <[email protected]>

* Ignore UT

Signed-off-by: Louis Chu <[email protected]>

* Add seqNo and primaryTerm to session object

Signed-off-by: Louis Chu <[email protected]>

* Address os client concurrency limitation

Signed-off-by: Louis Chu <[email protected]>

* Add interface for query execution

Signed-off-by: Louis Chu <[email protected]>

* Clean up logs and add UTs

Signed-off-by: Louis Chu <[email protected]>

* Clean up and fix UTs

Signed-off-by: Louis Chu <[email protected]>

---------

Signed-off-by: Louis Chu <[email protected]>
(cherry picked from commit aa509ac)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 28, 2024
…storage (#381)

* REPL refactor

Signed-off-by: Louis Chu <[email protected]>

* Ignore UT

Signed-off-by: Louis Chu <[email protected]>

* Add seqNo and primaryTerm to session object

Signed-off-by: Louis Chu <[email protected]>

* Address os client concurrency limitation

Signed-off-by: Louis Chu <[email protected]>

* Add interface for query execution

Signed-off-by: Louis Chu <[email protected]>

* Clean up logs and add UTs

Signed-off-by: Louis Chu <[email protected]>

* Clean up and fix UTs

Signed-off-by: Louis Chu <[email protected]>

---------

Signed-off-by: Louis Chu <[email protected]>
(cherry picked from commit aa509ac)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
noCharger pushed a commit that referenced this pull request Aug 28, 2024
…storage (#381) (#605)

* REPL refactor



* Ignore UT



* Add seqNo and primaryTerm to session object



* Address os client concurrency limitation



* Add interface for query execution



* Clean up logs and add UTs



* Clean up and fix UTs



---------


(cherry picked from commit aa509ac)

Signed-off-by: Louis Chu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
noCharger pushed a commit that referenced this pull request Sep 8, 2024
…storage (#381) (#604)

* REPL refactor



* Ignore UT



* Add seqNo and primaryTerm to session object



* Address os client concurrency limitation



* Add interface for query execution



* Clean up logs and add UTs



* Clean up and fix UTs



---------


(cherry picked from commit aa509ac)

Signed-off-by: Louis Chu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants